<?php
ini_set('display_errors', 1); 
ini_set('error_reporting', 'E_error'); 
 $fid=$_REQUEST['fid'];


if(isset($_REQUEST['CategoryKey']))
 {
	$comment=$_REQUEST['comment'];
        $rate=$_REQUEST['rate'];
        $fid=$_REQUEST['fid'];
     		
       $sql_addcat="Update tbl_feedback set comment='$comment',rate='$rate' where fid=$fid";
       $rst_addcat=mysql_query($sql_addcat) or die(mysql_error());
       
       $msgEditScat="<div id='suc-msg'> Feedback updated successfully.</div>";
	
	
	//$msgEditScat="Shipping Service Edited Successfully";
	
 }
 
 
$sqlSelEditfeedback="select * from tbl_feedback where fid=$fid";
$rstSelfeedback=mysql_query($sqlSelEditfeedback);
$rowSelfeedback=mysql_fetch_array($rstSelfeedback);
$comment=$rowSelfeedback['comment'];
$rate=$rowSelfeedback['rate'];

 
?>
<script src="<?php echo $base_url?>js/jquery-1.4.4.js" type="text/javascript"></script>
<table width="100%"  border="1" cellspacing="0" class="container">
  <tr>
    <td width="469" height="25" class="tdHeader">Edit Feedback<span style="text-align:right; padding-left:350px;"><input type='button' name='addsscat' value='Back' class='button' onClick="window.location='index.php?feedback'"  /></span></td>
  </tr>
  <tr>
    <td>	
          <form action="" method="post" name="formEditSubCat" id="formEditSubCat">
		  <input type="hidden" name="CategoryKey" id="CategoryKey" value="1">
           <table width="423" border="0" cellspacing="0" align="center">
          <tr>
            <td height="40" colspan="3"><div align="center"><?php echo "<b>".$msgEditScat."</b>"; ?></div></td>
            
          </tr>
		 
		  <tr>
		  	<td colspan="3">&nbsp;</td>
		  </tr>
         	 
	  <tr>
            <td height="31">&nbsp;</td>
            <td>Feedback </td>
            <td><textarea name="comment" id="comment" cols="25" rows="5"><?php echo $comment; ?></textarea></td>
          </tr>
	  
	   <tr>
	      <td height="29">&nbsp;</td>
	      <td><div align="left">Rateing</div></td>
	      <td><div align="left">
	           <table width="100%" align="center" border="0">
				<tr>
					<td>
						<table width="100%" border="0" >
          					<tr>
						  <td colspan="2">
							Your Options
						  </td>
						</tr>
						<tr>
						  <td width="10%">
							<input type="radio" name="rate" checked="checked" id="rate1" value="1" >
						  </td>
						  <td>
							Great
						  </td>
						</tr>
						<tr>
						  <td width="10%">
							<input type="radio" name="rate" id="rate2" value="2">
						  </td>
						  <td>
							Acceptable
						  </td>
						</tr>
						<tr>
						  <td width="10%">
							<input type="radio" name="rate" id="rate3" value="3">
						  </td>
						  <td>
							Negative
						  </td>
						</tr>
						<script language="javascript">
						  $('#rate'+<?php echo $rate?>).attr('checked','checked');
						</script>
						</table>
						<input type="hidden" name="fid" value="<?php echo $_REQUEST['fid']?>">
					</td>
				</tr>
			</table>
	      </div></td>
          </tr>
	  
          <tr>
            <td height="65" colspan="3"><div align="center">
                <input name="Submit" type="submit" value="Edit Feedback" class="button" onClick="return editfeedback();">
              </div></td>
         </tr>
        </table>
       </form>
     </td>
  </tr>
</table>

